beat the clock
Finish something or succeed before time is up, as in
The paper went to press at five o'clock, and they hurried to beat the clock
. The term comes from various sports or races in which contestants compete within a certain time limit.